package com.shop.cereshop.agent.service.order;

import com.baomidou.mybatisplus.extension.service.IService;
import com.shop.cereshop.agent.page.order.AgentOrderVO;
import com.shop.cereshop.agent.page.user.CereAgentUserVO;
import com.shop.cereshop.agent.param.order.OrderGetByIdDTO;
import com.shop.cereshop.agent.param.order.OrderPayDTO;
import com.shop.cereshop.agent.param.order.OrderSubmitDTO;
import com.shop.cereshop.commons.domain.order.CereAgentOrder;
import com.shop.cereshop.commons.exception.CoBusinessException;

import java.util.List;

import com.shop.cereshop.agent.param.settlement.SettlementDTO;
import com.shop.cereshop.agent.page.settlement.SettlementVO;

import javax.validation.Valid;

/**
 * 代理商订单Service
 */
public interface AgentOrderService extends IService<CereAgentOrder> {

  Long submitOrder(OrderSubmitDTO param, Long agentUserId) throws CoBusinessException, Exception;

  void cancelOrder(OrderGetByIdDTO param, Long agentUserId) throws CoBusinessException;

  /**
   * 根据用户查询订单列表
   *
   * @param agentUserId 用户id
   * @param orderType   订单类型（可为null，0表示查询除了套餐订单之外的所有类型）
   * @param state       订单状态
   * @param page        页码
   * @param pageSize    每页大小
   * @return 订单列表
   */
  List<AgentOrderVO> getOrderListByUser(Long agentUserId, Integer orderType, Integer state, Integer page,
      Integer pageSize);

  void deleteOrder(OrderGetByIdDTO param, CereAgentUserVO user) throws CoBusinessException;

  /**
   * 代理商结算查询
   *
   * @param param       结算查询参数
   * @param agentUserId 代理商用户ID
   * @return 结算数据
   */
  SettlementVO getSettlement(SettlementDTO param, Long agentUserId);

    void agentPayOrder(@Valid OrderPayDTO param, Long agentUserId) throws CoBusinessException;
}
